import React, { useState, useEffect } from 'react';
import Card from './Card.js'





export default function CardList(props) {
  
    return (
        <>
            {props.list.map((data) => (
                <Card key={data} data={data} />
            ))}
        </>
    );
}
//要使用时候使用props传递过来
const cardDataList = [
    {
        brandName: '弄堂里',
        brandLogo:
            'https://gw.alipayobjects.com/mdn/rms_7527d7/afts/img/A*anNdQqA_I_AAAAAAAAAAAAAAARQnAQ',
        distanceDesc: '500m',
        campImage:
            'https://gw.alipayobjects.com/mdn/rms_7527d7/afts/img/A*U29sSqgeU-4AAAAAAAAAAAAAARQnAQ',
        promoLogo: [
            'https://gw.alipayobjects.com/mdn/rms_7527d7/afts/img/A*y6CTRo9L2oEAAAAAAAAAAAAAARQnAQ',
            'https://gw.alipayobjects.com/mdn/rms_7527d7/afts/img/A*Q1d4SIoeKRkAAAAAAAAAAAAAARQnAQ',
        ],
        voucherDesc: '弄堂里14元超值优惠券包x2',
        benefitAmount: '1',
        oriPriceAmount: '28',
        discountDesc: '0.6折',
        voucherStockNum: '库存888份',
    },
    {
        brandName: '弄堂里',
        brandLogo:
            'https://gw.alipayobjects.com/mdn/rms_7527d7/afts/img/A*anNdQqA_I_AAAAAAAAAAAAAAARQnAQ',
        distanceDesc: '500m',
        campImage:
            'https://gw.alipayobjects.com/mdn/rms_7527d7/afts/img/A*U29sSqgeU-4AAAAAAAAAAAAAARQnAQ',
        promoLogo: [
            'https://gw.alipayobjects.com/mdn/rms_7527d7/afts/img/A*Q1d4SIoeKRkAAAAAAAAAAAAAARQnAQ',
        ],
        voucherDesc: '弄堂里14元超值优惠券包x2',
        benefitAmount: '1',
        discountDesc: '0.6折',
    },
    {
        brandName: '飞猪',
        brandLogo:
            'https://gw.alipayobjects.com/mdn/rms_7527d7/afts/img/A*dCL5Q4oBaQsAAAAAAAAAAAAAARQnAQ',
        campImage:
            'https://gw.alipayobjects.com/mdn/rms_7527d7/afts/img/A*MZ7VSaNZXRYAAAAAAAAAAAAAARQnAQ',
        promoLogo:
            'https://gw.alipayobjects.com/mdn/rms_7527d7/afts/img/A*90WEQLmnKdkAAAAAAAAAAAAAARQnAQ',
        voucherDesc: '南方航空20元优惠券',
        benefitAmount: '20',
    },
];